package com.qk.management.controller;

import com.qk.common.PageResult;
import com.qk.common.Result;
import com.qk.domain.customer.CustomerDO;
import com.qk.dto.customer.CustomerListDTO;
import com.qk.management.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/customers")
public class CustomerController {
    @Autowired
    private CustomerService customerService;
    @GetMapping
    public Result selectByPage(CustomerListDTO customerListDTO){
        PageResult<CustomerDO> customers = customerService.selectByPage(customerListDTO);
        return Result.success(customers);
    }
}
